package com.jt.consumer.service;

import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
/**
 * 远程服务回调工厂
 */
public class RemoteFileFallbackFactory implements FallbackFactory<RemoteProviderService> {
    @Override
    public RemoteProviderService create(Throwable throwable) {
        /*return new RemoteProviderService() {
            @Override
            public String echoMsg(String msg) {
                return "服务调用失败";
            }
        };*/
        return (msg)->{
            return "服务调用失败";
        };
    }
}
